let arr = [1, 2, 3, 4];

let res = [];

let final = arr.reduce((prev, current, currentIndex, arr) => {
    res.push(prev);
    return prev + current;
})
res.push(final);
console.log(res);


if (this.radio.indexOf(i) > -1) {
    let index = this.radio.indexOf(i);
    this.radio.splice(index, 1);
} else {
    this.radio.push(i);
}